﻿using System.Configuration;
using System.Net;
using System.Net.Mail;

namespace AxeFrog.Net.Mail
{
	[ExportMailSender("Default")]
	public class DefaultMailer : IMailSender
	{
		private string _standardServer;
		private string _fastServer;
		private int _port;
		private string _password;
		private string _username;

		public DefaultMailer()
		{
			//_standardServer = ConfigurationManager.AppSettings["CritSend.StandardServer"] ?? "smtp.critsend.com";
			//_fastServer = ConfigurationManager.AppSettings["CritSend.FastServer"] ?? "fast.critsend.com";
			//_port = int.Parse(ConfigurationManager.AppSettings["CritSend.SmtpPort"] ?? "587");
			//_username = ConfigurationManager.AppSettings["CritSend.Username"];
			//_password = ConfigurationManager.AppSettings["CritSend.Password"];
		}

		public void Send(MailAddress sender, MailAddress recipient, string subject, string body, bool isTimeCritical)
		{
			//var client = new SmtpClient(isTimeCritical ? _fastServer : _standardServer, _port);
			//client.Credentials = new NetworkCredential(_username, _password);
			//MailMessage msg = new MailMessage(sender, recipient);
			//msg.Subject = subject;
			//msg.Body = body;
			//client.Send(msg);
		}
	}
}
